x86emul: fix SYSCALL/SYSENTER/SYSEXIT emulation
authorJan Beulich <jbeulich@suse.com>
Thu, 25 Sep 2014 09:53:32 +0000 (11:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 25 Sep 2014 09:53:32 +0000 (11:53 +0200)
commit970cfb09da6704088ab12fe5014793f497d3654f
tree1400ac46ccf9562ab9459964df5952e3a6e47e5e
parentb67a26f0e174dda7d59ebee3673debd287205c67
x86emul: fix SYSCALL/SYSENTER/SYSEXIT emulation

SYSCALL:
- make sure SS selector has RPL 0
- only use 32 bits of RIP to fill RCX when target execution mode is 32-bit
- don't shadow function wide variable 'rc'
- consolidate CS attribute setting into single statements
- drop pointless initializers and casts
- drop redundant MSR_STAR read (as suggested by Andrew Cooper)

SYSENTER/SYSEXIT:
- #GP condition doesn't depend on guest mode
- only use 32 bits for setting RIP/RSP when target execution mode is 32-bit
- don't shadow function wide variable 'rc'
- consolidate CS attribute setting into single statements
- drop pointless (and inconsistently used) casts

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c